<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html>
<html>
  <head>
    <title>返现</title>
    <base href="<%=basePath%>">
  </head>
  
  <body>
  
  	<jsp:include page="common.jsp"></jsp:include>
  	<jsp:include page="alert.jsp"></jsp:include>
  	
  	<div class="secMenu-content">
  		<div class="list-hearBar">
	  		<a class="btn btn-primary list-headBtn" href="electric/jsp/market_cashBackNew.jsp">新增返现</a>
  			
  			<form class="form-inline list-headRight right" role="form">
				<input type="text" class="form-control" placeholder="请输入活动名称">
				
				<button type="submit" class="btn btn-info">搜索</button>
			</form>
  		</div>
  	
  	 	<table class="table table-hover table-striped table-condensed list-table">
	      <thead>
	        <tr>
	          <th>编号</th>
	          <th>返现名称</th>
	          <th>面额</th>
	          <th>开始时间</th>
	          <th>结束时间</th>
	          <th>状态</th>
	          <th>操作员</th>
	          <th>最后操作时间</th>
	          <th>操作</th>
	        </tr>
	      </thead>
	      
	      <tbody>
	        <tr>
	          <td>201</td>
	          <td>SKKD双11活动</td>
	          <td>20.0</td>
	          <td>2017-11-11</td>
	          <td>2017-11-12</td>
	          <td class="list-state list-state-0">已暂停</td>
	          <td>李红</td>
	          <td>2017-11-11 12:00</td>
	          <td class="list-action">
	          	<a href="electric/jsp/market_cashBackIssue.jsp">发放记录</a>
	          	<a href="javascript:;" class="list-switch list-switch-on">开启</a>
	          	<a href="javascript:;" class="list-switch list-switch-off" style="display: none;">暂停</a>
	          	<a href="electric/jsp/market_cashBackNew.jsp">查看/修改</a>
	          	<a href="javascript:;" class="delTr">删除</a>
	          </td>
	        </tr>
	        
	          <tr>
		          <td>202</td>
		          <td>SKKD双11活动</td>
		          <td>20.0</td>
		          <td>2017-11-11</td>
		          <td>2017-11-12</td>
		          <td class="list-state list-state-1">已开启</td>
		          <td>李红</td>
		          <td>2017-11-11 12:00</td>
		          <td class="list-action">
		          	<a href="electric/jsp/market_cashBackIssue.jsp">发放记录</a>
		          	<a href="javascript:;" class="list-switch list-switch-on">开启</a>
		          	<a href="javascript:;" class="list-switch list-switch-off" style="display: none;">暂停</a>
		          	<a href="electric/jsp/market_cashBackNew.jsp">查看/修改</a>
		          	<a href="javascript:;" class="delTr">删除</a>
		          </td>
		        </tr>
	      </tbody>
	    </table>
	    
	    <nav>
		  <ul class="pagination right">
		    <li><a href="javascript:;">首页</a></li>
		    <li class="active"><a href="javascript:;">1</a></li>
		  	<li><a href="javascript:;">2</a></li>
		    <li><a href="javascript:;">3</a></li>
		    <li><a href="javascript:;">4</a></li>
		    <li><a href="javascript:;">5</a></li>
		    <li><a href="javascript:;">尾页</a></li>
		  </ul>
		</nav>
	</div>
	
	<script type="text/javascript">
		$(document).ready(function(){
			leftMenu.initBlock4_3();//左菜单栏初始化
			listSwitch();//单独开启、单独暂停
			delEvent();//删除当前一行
		});
		
		function listSwitch(){
			//单独开启
			$(".list-switch-on").on("click",function(){
				var thisItem=$(this);
				thisItem.css("display","none");
				thisItem.siblings(".list-switch").css("display","inline-block");
				thisItem.parents("tr").find(".list-state").text("已开启").css("color","#34D63A");
			});
			//单独暂停
			$(".list-switch-off").on("click",function(){
				var thisItem=$(this);
				thisItem.css("display","none");
				thisItem.siblings(".list-switch").css("display","inline-block");
				thisItem.parents("tr").find(".list-state").text("已暂停").css("color","red");
			});
			
		}
		
		function delEvent(){
			//删除框的确定事件
			$(".delSureBtn").on("click",function(){
				var thisBtn=$(this);
				$(".delFlag").css("display","none");//删除设有删除标记的行
				$(".newAlertBox").remove();
			});
			//删除框的取消事件
			$(".delOffBtn").on("click",function(){
				$(".list-table tr").removeClass("delFlag");//当删除框取消时，全部删除标记消失
			});
		}
		
	</script>
  </body>
</html>

